Four Apt Elementary Examples of Recursion
نویسنده
چکیده
We give four elementary examples of recursion that are reallife, non-trivial, more natural than the corresponding iterative approach, and do not involve any sophisticated algorithms, data structures, or mathematical problems. The examples are two forms of writing numbers in words, coalescing page references for an index, and finding unclosed begin blocks. My New Zoo, McGrew Zoo, will make people talk. My New Zoo, McGrew Zoo, will make people gawk At the strangest odd creatures that ever did walk. I’ll get, for my zoo, a new sort-of-a-hen Who roosts in another hen’s topknot, and then Another one roosts in the topknot of his, And another in his, and another in HIS, And so forth and upward and onward, gee whiz! —Dr. Seuss: If I Ran the Zoo
منابع مشابه
Cs - R 9543 1995
We claim that programming within the logic programming paradigm suuers from lack o f attention given to iteration and arrays. To c o n vince the reader about their merits we present several examples of logic and constraint logic programs which use iteration and arrays instead of explicit recursion and lists. These programs are substantially simpler than their counterparts written in the convent...
متن کاملComplexity of Model Checking Recursion Schemes for Fragments of the Modal Mu-Calculus
Ong has shown that the modal mu-calculus model checking problem (equivalently, the alternating parity tree automaton (APT) acceptance problem) of possibly-infinite ranked trees generated by order-n recursion schemes is n-EXPTIME complete. We consider two subclasses of APT and investigate the complexity of the respective acceptance problems. The main results are that, for APT with a single prior...
متن کاملNew Ways to Measure Systemic Change : Map & Analyze Patterns & Structures Across Time
Map & Analyze Patterns & Structures Across Time (MAPSAT) is a new set of mapping tools that are appropriate for analyses of system dynamics and structure in education. MAPSAT consists of two complementary methodologies: Analysis of Patterns in Time (APT) and Analysis of Patterns in Configuration (APC). In APT, a researcher creates temporal maps by observing phenomena and coding sequential and s...
متن کاملUnscented Auxiliary Particle Filter Implementation of the Cardinalized Probability Hypothesis Density Filters
The probability hypothesis density (PHD) filter suffers from lack of precise estimation of the expected number of targets. The Cardinalized PHD (CPHD) recursion, as a generalization of the PHD recursion, remedies this flaw and simultaneously propagates the intensity function and the posterior cardinality distribution. While there are a few new approaches to enhance the Sequential Monte Carlo (S...
متن کاملOPUS: a Formal Approach to Object-Orientation
OPUS is an elementary calculus that models object-orientation. It expresses in a direct way the crucial features of object-oriented programming such as objects, encapsulation, message passing and incremental modification. This is illustrated by numerous examples. Thanks to the way objects are constructed in this calculus, we can deal with selfreference, recursion and even mutual recursion in a ...
متن کامل